package org.example.intelligent_education.mapper;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.example.intelligent_education.model.CourseInfo;
import org.example.intelligent_education.model.CourseSource;

import java.util.List;

@Mapper
public interface CourseMapper {
    @Select("select * from course_info where cname =#{cname} and del = 0")
    CourseInfo getCourseInfoByName(String cname);

    @Select("select *from course_info where del =0")
    List<CourseInfo> getAllCourseInfo();

    @Select("select caname from course_classify")
    List<String> getAllCourseClassify();

    @Select("select * from course_info where caname =#{caname} and del =0")
    List<CourseInfo> getCourseInfoByCaname(String caname);

    @Select("select * from course_source where cid =#{cid}")
    CourseSource getCourseSourceByCid(int cid);
}
